import 'package:flutter/material.dart';
import 'coupon_shape_border.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class CouponItem extends StatefulWidget {
  @override
  _CouponItemState createState() => _CouponItemState();
}

class _CouponItemState extends State<CouponItem> {
  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        Container(
          width: 250.w,
          height: 120.w,
          child: Material(
            color: Colors.orangeAccent,
            elevation: 0,
            shape: CouponShapeBorder(),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: [
                RichText(
                  text: TextSpan(children: [
                    TextSpan(
                        text: '￥',
                        style: TextStyle(fontSize: 28.sp)),
                    TextSpan(
                      text: '100.00',
                      style: TextStyle(
                          fontSize: 45.sp,
                          fontWeight: FontWeight.bold),
                    ),
                  ]),
                ),
                Text(
                  '满300元可用',
                  style: TextStyle(
                      color: Colors.white,
                      fontWeight: FontWeight.bold),
                )
              ],
            ),
          ),
        ),
        SizedBox(
          width: 30.w,
        ),
        Expanded(
          child: Column(
            children: [
              Row(
                mainAxisAlignment:
                MainAxisAlignment.spaceBetween,
                children: [
                  Container(
                    alignment: Alignment.center,
                    child: Text('通用券',style: TextStyle(color: Colors.black54,fontSize: 25.sp),),
                    width: 150.w,
                    height: 50.w,
                    decoration: BoxDecoration(
                        border: Border.all(
                          color: Colors.grey,
                        ),
                        borderRadius: BorderRadius.all(
                            Radius.circular(25))),
                  ),
                  Text('新用户优惠券')
                ],
              ),
              SizedBox(
                height: 20.w,
              ),
              Row(
                mainAxisAlignment:
                MainAxisAlignment.spaceBetween,
                children: [
                  Text('2020/2/5'),
                  Container(
                    alignment: Alignment.center,
                    width: 150.w,
                    height: 50.w,
                    decoration: BoxDecoration(
                      color: Colors.red,
                      borderRadius:
                      BorderRadius.all(Radius.circular(35)),
                    ),
                    child: Text(
                      '已过期',
                      style: TextStyle(color: Colors.white,fontSize: 25.sp),
                    ),
                  )
                ],
              )
            ],
          ),
        )
      ],
    );
  }
}
